feat: structured data (JSON-LD) and metadata completeness#13
Merged
Conversation
Add schema.org structured data and fill metadata gaps so search and AI
crawlers can understand the site and each tool.
- lib/jsonLd.ts (new): one home for all JSON-LD builders, each derived from
the TOOLS registry so it can't drift from what renders.
- FAQPage from the registry FAQs (the FAQs were already written but nothing
emitted them); gated to pages that actually render an FAQ section
- Organization + WebSite + ItemList @graph on the homepage, linked by @id
- BreadcrumbList on tool pages (Home > Tool)
- toolJsonLd (SoftwareApplication) moved here from lib/toolMetadata.ts
- ToolPageLayout: emit the three JSON-LD blocks and render a real visible
Home > Tool breadcrumb (so the schema represents visible content). The
heroBreadcrumb tagline sits outside the <nav> so it isn't announced as a
crumb, and the current crumb uses --fg to clear WCAG AA contrast.
- Homepage: canonical, inheriting the root OpenGraph rather than clobbering it.
- Root metadata: OpenGraph locale/title/description and twitter:site.
- Per-tool OpenGraph gains siteName + locale.
Deliberately skipped: SearchAction/sitelinks searchbox (no site search;
deprecated in 2024), and any aggregateRating (no honest ratings to claim).
All JSON-LD verified as valid against the rendered HTML. build, lint, and
27 tests pass.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds schema.org structured data and fills the remaining metadata gaps so search engines and AI answer engines can understand the site and each tool. Everything derives from the
TOOLSregistry, so the structured data can't drift from what renders.Changes
New
lib/jsonLd.ts— one home for all JSON-LD builders:tool.faqs.length > 0), so json-formatter (no FAQs) emits none.@graphon the homepage, linked by@id(WebSite publisher references the Organization). The ItemList mirrors the visible tool grid in the same order.itemper Google's spec.toolJsonLd(SoftwareApplication) moved here fromlib/toolMetadata.ts.components/shared/ToolPageLayout.tsx— emits the three JSON-LD blocks and renders a real visible Home > Tool breadcrumb, so the schema represents content the page actually shows (Google's structured-data policy). TheheroBreadcrumbtagline is kept but moved outside the<nav>/<ol>so screen readers don't announce it as a third crumb, and the current crumb uses--fg(not the tool accent) to clear WCAG AA contrast in light mode.Metadata completeness:
canonical(inherits the root OpenGraph rather than clobbering it via Next's shallow merge).locale/title/description; Twitter gainssite.siteName+locale.Deliberately skipped (with reasons)
toolbeltrepo URL insameAs—sameAsis for the Organization's identity profiles (the GitHub org), not a content link.How it was verified
https://tools.codercops.com, no trailing slash).npm run build,npm run lint,npm run test(27/27) pass.Approach note
Recommendations were researched and adversarially fact-checked against current (2026) Google Search Central / schema.org / Next.js docs before implementing — notably that FAQ rich results are restricted since 2023 (we still emit valid FAQPage for other engines and AI, since the FAQ is genuinely visible) and that the sitelinks searchbox is gone.
Second PR in the SEO plan. Next: on-site GitHub link + live star count, then the README overhaul.